package com.zhen;

import com.zhen.domain.User;
import com.zhen.factory.FKSqlSessionFactory;
import com.zhen.mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;

public class UpdateTest {

    public static void main(String[] args) {
        SqlSession session = FKSqlSessionFactory.getSqlSession();
        UserMapper userMapper = session.getMapper(UserMapper.class);
        User user = userMapper.selectUserById(5);
        user.setName("update");
        user.setSex("女");
        user.setAge(19);
        userMapper.modifyUser(user);

        session.commit();
        session.close();

    }

}
